// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

#include "Pickable.h"


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

struct PickableWrap : Pickable, bpy::wrapper<Pickable>
{
    void draw(View3d* v) const override
    {
        get_override("draw")(bpy::ptr(v));
    }

    bool isSelectable() const override
    {
        return true;
    }

    void setColorIfNotPicking(View3d* view, const Color& color)
    {
        Pickable::setColorIfNotPicking(view, color);
    }
};

void pyInitPickable()
{
    bpy::class_<PickableWrap, ref<PickableWrap>,
                bpy::bases<Drawable, Selectable>, 
                boost::noncopyable>("Pickable")
        .def("draw", bpy::pure_virtual(&Pickable::draw))
        .def("isSelectable", bpy::pure_virtual(&Pickable::isSelectable))
        .def("setColorIfNotPicking", &PickableWrap::setColorIfNotPicking)
    ;
}
